home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGASIC
/
BASFILES.LZH
/
MESSAGE.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-09-10
|
2KB
|
90 lines
'$INCLUDE:'QBTOOLS.INC'
'' DECLARE SUB Message (Text$(), textc%, Border%, Bf%, Bb%, Gf%, Gb%)
'' '$INCLUDE: 'qbtools2.inc'
'DIM Text$(11)
'Text$(1) = "You have reached THIS part of"
'Text$(2) = "the program because you are an idiot."
'Text$(3) = ""
'Text$(4) = "Please re-run it from the start."
'Text$(5) = "FOOL!"
'Text$(6) = ""
'Text$(7) = "Good Condition"
'Text$(8) = "Try this"
'Text$(9) = "Here is another one for you to test and check around"
'Text$(10) = ""
'Text$(11) = "This is a banana Item"
'FOR j% = 1 TO 7
' Message Text$(), 11, j%, 7, 0, 0, 7
'NEXT j%
SUB Message (Text$(), textc%, Border%, Bf%, Bb%, Gf%, Gb%)
' Text1$ - Text to display
' Textc% - Text ITEMS to display
' Border% - Border type
' Bf% - Border foreground color
' Bb% - Border backgroynd color
' Gf% - Global foreground
' Gb% - Global background
'$DYNAMIC
REDIM Saver%(2000)
MaxWidth% = 0
El% = UBOUND(Text$, 1)
IF textc% > El% THEN
EXIT SUB
END IF
FOR j% = 1 TO textc%
trim Text$(j%)
MaxWidth% = Maximum%(MaxWidth%, LEN(Text$(j%)))
NEXT j%
MaxWidth% = MaxWidth% + 4 ' Plus borders
MaxHeight% = textc% + 4 ' Plus Borders
IF MaxWidth% > 80 THEN
EXIT SUB ' TOO Wide
END IF
IF MaxHeight% > 24 THEN ' TOO High
EXIT SUB
END IF
TopRow% = 24 - MaxHeight% ' Top row
TopRow% = TopRow% / 2
LeftCol% = 80 - MaxWidth% ' Left column
LeftCol% = LeftCol% / 2
SaveScreen Saver%(1) ' Save the screen
DrawBox TopRow%, LeftCol%, MaxWidth%, MaxHeight%, Border%, Bf%, Bb%, 1, Gf%, Gb%
Attr% = Attributes%(Gf%, Gb%, 0, 0)
FOR j% = 1 TO textc%
Diff% = (MaxWidth% - LEN(Text$(j%)))
IF Diff% THEN
Diff% = Diff% / 2
END IF
TextToPrint$ = Text$(j%)
Row% = j% + TopRow% + 1
Col% = LeftCol% + Diff%
ColorPrint TextToPrint$, Row%, Col%, Attr%
NEXT j%
Pause
RestoreScreen Saver%(1)
END SUB